const Article = require('../../models/article')

module.exports = (req, res) => {
  const article_id = req.query.parmas
  // console.log(req.query.parmas)
  // console.log(req.query)
  Article.findById({ _id: article_id }, (err, articleDoc) => {
    if (err) {
      return res.status(500).json({
        err_code: 500,
        message: err.message
      })
    }
    const newArticleDoc = JSON.stringify(articleDoc)
    res.status(200).json({
      err_code: 0,
      data: newArticleDoc,
      message: 'success'
    })
    // console.log(articleDoc);
  })
}